var appUtility = require('./apputility.js');

function Event (pEventName, pEventType) {
	
	this.header = {
				'eventname':'',
				'eventtype':'REQUEST',
				'eventkey': appUtility.getKey(),				
				'respeventname': null
			};
	this.data = {
				//'params': {}
			};
	
	
	if (pEventName) this.header.eventname = pEventName.toUpperCase();
	if (pEventType) this.header.eventtype = pEventType.toUpperCase();
	
	this.setEventName = function (p) {
		this.header.eventname = p.toUpperCase();
	};
	this.getEventName = function () {
		return this.header.eventname;
	};
	
	this.setEventType = function (p) {
		this.header.eventtype = p.toUpperCase();
	};
	this.getEventType = function () {
		return this.header.eventtype;
	};
	
	/*this.setStackName = function (p) {
		this.header.stackname = p;
	};
	*/
	this.getStackName = function () {
		return this.header.stackname;
	};
	
	this.setClientId= function (p) {
		this.header.clientid = p;
	};
	this.getClientId= function () {
		return this.header.clientid;
	};
	
	this.setEventKey= function (p) {
		this.header.eventkey = p;
	};
	this.getEventKey= function () {
		return this.header.eventkey;
	};
	
	/*this.setRequestId= function (p) {
		this.header.requestedSessionId = p;
	};
	this.getRequestId= function () {
		return this.header.requestedSessionId;
	};
	*/
	this.setRespEventName = function (p) {
		this.header.respeventname = p;
	};
	this.getRespEventName = function () {
		return this.header.respeventname;
	};
	
	this.setPayload = function(p) {
		this.data = p;
	};
	this.getPayload = function() {
		return this.data;
	};
	
}
module.exports = Event;

/*
	eventObj.header.eventname = 'TCP.REQUEST';
	eventObj.header.eventtype = 'REQUEST';
	eventObj.header.eventkey = appUtility.getKey();
	eventObj.header.stackname = socket._StackObj._Config.NAME;
	eventObj.header.clientid = socket.CLIENTID || 0;
	eventObj.header.respeventname = 'STACK';
	eventObj.data.params =jsonObj;
	
*/